-- GENERATED SPELL FOR [Lord Melenas] --


function spell0_2038(pUnit, Event) --@Cat Form,Self--
pUnit:FullCastSpellOnTarget(5759,pUnit)
pUnit:RegisterEvent('Sorts_2038', 0, 1)
end

function spell1_2038(pUnit, Event) --@Rake,n/a--
pUnit:FullCastSpellOnTarget(1822,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2038', 9000, 1)
end

function spell2_2038(pUnit, Event) --@Rejuvenation,n/a--
pUnit:FullCastSpellOnTarget(774,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2038', 12000, 1)
end

function Sorts_2038(pUnit, Event)
local choix_sorts_2038 = math.random(0, 2)
if choix_sorts_2038 == 0 then
pUnit:RegisterEvent('spell0_2038', 1, 1)
end
if choix_sorts_2038 == 1 then
pUnit:RegisterEvent('spell1_2038', 1, 1)
end
if choix_sorts_2038 == 2 then
pUnit:RegisterEvent('spell2_2038', 1, 1)
end
end

function mob2038_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2038', math.random(1500, 3000), 1)
end

function mob2038_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2038_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2038_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2038, 1, 'mob2038_Action')
RegisterUnitEvent(2038, 2, 'mob2038_Leave')
RegisterUnitEvent(2038, 3, 'mob2038_Kill')
RegisterUnitEvent(2038, 4, 'mob2038_Die')
